package com.yicong.ants.manager.ad;

import com.cchao.simplelib.LibCore;
import com.cchao.simplelib.core.CollectionHelper;
import com.umeng.analytics.MobclickAgent;

import java.util.HashMap;
import java.util.Map;

/**
 * 事件统计
 *
 * @author cch
 * @version 1-4
 */
public class EventHelper {

    /**
     * 上报事件
     */
    public static void reportEvent(String name) {
        reportEvent(name, null);
    }

    public static void reportEvent(String name, Map<String, Object> map) {
        if (CollectionHelper.isEmpty(map)) {
            map = new HashMap<>();
            map.put("action", "default");
        }
        MobclickAgent.onEventObject(LibCore.getContext(), name, map);
    }
}